package com.hornsun.data.constant.types;

/**
 * Created by 编译中... on 2018/6/12.
 */
public enum DataPackType {
    dptLoginData(44,"登录数据"),
    dptHeartBeatData(20,"心跳数据"),
    dptLogoutData(24,"登出数据");

    private Integer type;
    private String name;

    DataPackType(Integer type ,String name){this.type=type;this.name=name;}

    public Integer getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static DataPackType dataPackTypeByName(String name) {
        for (DataPackType dataPackType : values()) {
            if (dataPackType.name.equals(name) ) {
                return dataPackType;
            }
        }
        return null;
    }
    public static DataPackType dataPackTypeByType(Integer type) {
        for (DataPackType dataPackType : values()) {
            if (dataPackType.type.equals(type)) {
                return dataPackType;
            }
        }
        return null;
    }

}
